import pygetwindow as gw

# 获取所有窗口的标题
window_titles = gw.getAllTitles()

# 打印所有窗口的标题
for title in window_titles:
    print(title)